package com.yphone.ui.login.presenter;

import com.yphone.ui.login.*;
import com.yphone.ui.login.bean.request.LoginRequestInfo;
import com.yphone.ui.login.contract.*;
import com.yphone.ui.login.model.LoginActivityModel;

public class LoginActivityPresenter implements LoginActivityContract.IPresenter {
    private LoginActivityContract.IView mIView;
    private LoginActivityModel mImodel;
    public LoginActivityPresenter(LoginActivityContract.IView iView) {
        this.mIView = iView;
        this.mIView.setPresenter(this);
        mImodel = new LoginActivityModel(this.mIView.getContext(), this.mIView.getNextStep());
    }

    public void start() {
    }

    public void destory() {
//        if (this.mImodel != null) {
//            this.mImodel.destory();
//        }
    }

    public void requestLoginEvent(String phoneNumber, String password) {
        LoginRequestInfo loginRequestInfo = new LoginRequestInfo();
        loginRequestInfo.username = phoneNumber;
        loginRequestInfo.password = password;
        this.mImodel.requestLoginToSer(loginRequestInfo);
    }

    public void getWxTokenInfo(String code, String appid, String appSecret) {
//        this.mImodel.requestWxToken(appid, appSecret, code);
    }
}